﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Globalization;
using System.Windows;

namespace BDSim
{
    /// <summary>
    /// 模型类型转换到对应图标
    /// </summary>
    public class ModelTypeToImage:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            //ModelType modelType = (ModelType)value;
            string ImagePath = "";
            //switch (modelType)
            //{
            //    case ModelType.Satellite:
            //        ImagePath = @"/BDSim;component/Resources/Images/IGSO.png";
            //        break;
            //    case ModelType.MasterStation:
            //        ImagePath = @"/BDSim;component/Resources/Images/主控站.png";
            //        break;
            //    case ModelType.InjectionStation:
            //        ImagePath = @"/BDSim;component/Resources/Images/注入站.png";
            //        break;
            //    case ModelType.MonitorStation:
            //        ImagePath = @"/BDSim;component/Resources/Images/监测站.png";
            //        break;
            //    case ModelType.KaManageStation:
            //        ImagePath = @"/BDSim;component/Resources/Images/测控站.png";
            //        break;
            //    case ModelType.ManageCenterStation:
            //        ImagePath = @"/BDSim;component/Resources/Images/测控中心.png";
            //        break;
            //    case ModelType.UserDevice:
            //        ImagePath = @"/BDSim;component/Resources/Images/UserModel.png";
            //        break;
            //    default:
            //        break;
            //}
            return ImagePath;
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    public class DeviceTypeToImage : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            EUserType modelType = (EUserType)value;
            string ImagePath = "";
            switch (modelType)
            {
                case EUserType.Car:
                    ImagePath = @"/BDSim;component/Resources/Images/CarDevice.png";
                    break;
                case EUserType.Aircraft:
                    ImagePath = @"/BDSim;component/Resources/Images/Aircraft1.png";
                    break;
                //case DeviceType.Boat:
                //    ImagePath = @"/BDSim;component/Resources/Images/boat1.png";
                //    break;
                case EUserType.Missile:
                    ImagePath = @"/BDSim;component/Resources/Images/SatIcon.png";
                    break;
                default:
                    break;
            }
            return ImagePath;
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    public class DeviceTypeToVisiblity : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            EUserType modelType = (EUserType)value;
            Visibility visible = Visibility.Collapsed;
            if (modelType == EUserType.Missile)
            {
                visible = Visibility.Visible;
            }
            return visible;
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
